library(xlsx);library(dplyr);library(lubridate)
options(scipen=999) #remove scientific notation
data <- read.csv2("taux_utilisation_actes.csv")
data_eat <- data[data$eat == "Oui",]
data_eat
#window size
max.window.size <- 5 #size of the window = number of collaborative acts per window
max.window.size
[1] 5
#dyad having used the emotion awareness tool (eat condition) for sharing their emotions
dyads_eat <- c(
"D02",
"D05",
"D07",
"D09",
"D13",
"D16",
"D21",
"D23",
"D26",
"D27",
"D29")
#participants in eat condition
participants_eat <- c(
"D02P01",
"D02P02",
"D05P01",
"D05P02",
"D07P01",
"D07P02",
"D09P01",
"D09P02",
"D13P01",
"D13P02",
"D16P01",
"D16P02",
"D21P01",
"D21P02",
"D23P01",
"D23P02",
"D26P01",
"D26P02",
"D27P01",
"D27P02",
"D29P01",
"D29P02")
#participants in no-eat condition
participants_no_eat <- c(
"D04P01",
"D04P02",
"D06P01",
"D06P02",
"D08P01",
"D08P02",
"D10P01",
"D10P02",
"D12P01",
"D12P02",
"D15P01",
"D15P02",
"D20P01",
"D20P02",
"D24P01",
"D24P02")
# #emotions displayed during the collaborative problem-solving
# emotions <- c(
# "interested",
# "focused",
# "delighted",
# "satisfied",
# "confident",
# "amused",
# "relieved",
# "relaxed",
# "confused",
# "stressed",
# "dissatisfied",
# "annoyed",
# "frustrated",
# "grateful",
# "disappointed",
# "empathic",
# "bored",
# "surprised",
# "puzzled",
# "anxious",
# "impatient")
#All collaborative acts emitted by participants
# collaborative.processes <- c(
# "accept",
# "agree",
# "check.comprehension",
# "check.reception",
# "coordinate.teamwork",
# "disagree",
# "elicit.opinion",
# "elicit.partner.information",
# "elicit.proposition",
# "elicit.recall",
# "elicit.task.information",
# "give.explanation",
# "give.opinion.against",
# "give.opinion.for",
# "give.proposition",
# "give.recall",
# "give.self.information",
# "give.task.information",
# "incorporate",
# "manage.task",
# "other",
# "outside.activity",
# "relax.atmosphere",
# "show.active.listening",
# "show.reflection",
# "show.hostility",
# "show.solidarity",
# "tool.discourse",
# "use.social.convention")
#All collaborative acts emitted by participants representing at least 4 percents of the total
collaborative.processes <- c(
"accept",
"agree",
"give.opinion.for",
"give.proposition",
"give.self.information",
"give.task.information",
"manage.task",
"relax.atmosphere",
"show.reflection",
"tool.discourse")
#emotions displayed during the collaborative problem-solving representating at least
emotions <- c(
"interested",
"focused",
"delighted",
"satisfied",
"amused",
"relaxed")
If there is not at least (max.window.size) collaborative processes following the emotion of interest -> this occurence is not taken into account for the computation of the relative use
If an emotion overlaps with one another (i.e., a new same emotion) is met before (max.window.size) is reached, this latest occurence is not taken into account for the compuation of the relative use
#Find cases available (participants that have shared the emotion)
interested.cases <- c()
emotion = "interested"
for (participant in participants_eat) {
print(paste("Pour le participant ", participant," il y a", length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")]),"correspondance(s)"))
interested.cases[participant] <- length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")])
}
[1] "Pour le participant D02P01 il y a 2 correspondance(s)"
[1] "Pour le participant D02P02 il y a 3 correspondance(s)"
[1] "Pour le participant D05P01 il y a 0 correspondance(s)"
[1] "Pour le participant D05P02 il y a 1 correspondance(s)"
[1] "Pour le participant D07P01 il y a 1 correspondance(s)"
[1] "Pour le participant D07P02 il y a 2 correspondance(s)"
[1] "Pour le participant D09P01 il y a 3 correspondance(s)"
[1] "Pour le participant D09P02 il y a 4 correspondance(s)"
[1] "Pour le participant D13P01 il y a 1 correspondance(s)"
[1] "Pour le participant D13P02 il y a 3 correspondance(s)"
[1] "Pour le participant D16P01 il y a 2 correspondance(s)"
[1] "Pour le participant D16P02 il y a 3 correspondance(s)"
[1] "Pour le participant D21P01 il y a 2 correspondance(s)"
[1] "Pour le participant D21P02 il y a 1 correspondance(s)"
[1] "Pour le participant D23P01 il y a 2 correspondance(s)"
[1] "Pour le participant D23P02 il y a 2 correspondance(s)"
[1] "Pour le participant D26P01 il y a 1 correspondance(s)"
[1] "Pour le participant D26P02 il y a 0 correspondance(s)"
[1] "Pour le participant D27P01 il y a 0 correspondance(s)"
[1] "Pour le participant D27P02 il y a 1 correspondance(s)"
[1] "Pour le participant D29P01 il y a 2 correspondance(s)"
[1] "Pour le participant D29P02 il y a 3 correspondance(s)"
interested.available.cases <- interested.cases[interested.cases != 0]
interested.available.cases
D02P01 D02P02 D05P02 D07P01 D07P02 D09P01 D09P02 D13P01 D13P02 D16P01 D16P02 D21P01 D21P02 D23P01 D23P02 D26P01
2 3 1 1 2 3 4 1 3 2 3 2 1 2 2 1
D27P02 D29P01 D29P02
1 2 3
length(interested.available.cases)
[1] 19
names(interested.available.cases)
[1] "D02P01" "D02P02" "D05P02" "D07P01" "D07P02" "D09P01" "D09P02" "D13P01" "D13P02" "D16P01" "D16P02" "D21P01"
[13] "D21P02" "D23P01" "D23P02" "D26P01" "D27P02" "D29P01" "D29P02"
#interested sample
participants_eat_interested_P01 <- c("D02P01","D07P01","D09P01","D13P01","D16P01","D21P01","D23P01","D26P01","D29P01")
participants_eat_interested_P02 <- c("D02P02","D05P02","D07P02","D09P02","D13P02","D16P02","D21P02","D23P02","D27P02","D29P02")
#Compute the real-time use for the emotion interested
#select the subset of collaborative processes for a given participant. For the emotion interested, the (max.windows.size) collaborative processes of the other's partner from the same dyad are selected
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
interested.table.p2 <- data.frame(n)
rownames(interested.table.p2) <- collaborative.processes
for (p in participants_eat_interested_P01)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
interested.collaborative.processes.table <- data.frame(m)
interested.times <- data[which(data$participant == p & data$shared.emotion =="interested"),c("unix.time.video")]
interested.times.length <- length(interested.times)
for (i in seq(1:length(interested.times)))
{
interested.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > interested.times[i]),c("collaborative.processes")][1:max.window.size]
}
interested.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(interested.collaborative.processes.table)){
if (anyNA(interested.collaborative.processes.table[,col])) {
interested.times.length <- interested.times.length-1
interested.collaborative.processes.table = interested.collaborative.processes.table[,!(names(interested.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(interested.collaborative.processes.table[interested.collaborative.processes.table == i])
}
x <- x/interested.times.length #number of emotion windows
interested.table.p2[,paste0(substr(p, 1, 5),"2")] = x
}
interested.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
interested.table.p1 <- data.frame(n)
rownames(interested.table.p1) <- collaborative.processes
for (p in participants_eat_interested_P02)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
interested.collaborative.processes.table <- data.frame(m)
interested.times <- data[which(data$participant == p & data$shared.emotion == "interested"),c("unix.time.video")]
interested.times.length <- length(interested.times)
for (i in seq(1:length(interested.times)))
{
interested.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > interested.times[i]),c("collaborative.processes")][1:max.window.size]
}
interested.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(interested.collaborative.processes.table)){
if (anyNA(interested.collaborative.processes.table[,col])) {
interested.times.length <- interested.times.length-1
interested.collaborative.processes.table = interested.collaborative.processes.table[,!(names(interested.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(interested.collaborative.processes.table[interested.collaborative.processes.table == i])
}
x <- x/interested.times.length #number of emotion windows
interested.table.p1[,paste0(substr(p, 1, 5),"1")] = x
}
interested.table.p1
interested.table <- cbind(interested.table.p1, interested.table.p2)
interested.table
#Compute the real-time when no emotion interested
#Select a subset of the data not including the emotion windows
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.interested.table.p2 <- data.frame(n)
rownames(non.interested.table.p2) <- collaborative.processes
for (p in participants_eat_interested_P01)
{
interested.times <- data[which(data$participant == p & data$shared.emotion =="interested"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(interested.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > interested.times[i])[1:max.window.size])
}
#remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)]
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotion windows
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"2"),]
#Keep a number of lines that is a multiple of max.windows.size = number of no-emotion windows
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.interested.table.p2[,paste0(substr(p, 1, 5),"2")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.interested.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.interested.table.p1 <- data.frame(n)
rownames(non.interested.table.p1) <- collaborative.processes
for (p in participants_eat_interested_P02)
{
interested.times <- data[which(data$participant == p & data$shared.emotion =="interested"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(interested.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > interested.times[i])[1:max.window.size])
}
#remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)]
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotion windows
print(data.kept)
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"1"),]
#keep a number of lines that is a multiple of max.windows.size = number of no-emotion window
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.interested.table.p1[,paste0(substr(p, 1, 5),"1")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.interested.table.p1
non.interested.table <- cbind(non.interested.table.p1, non.interested.table.p2)
non.interested.table
for (col in colnames(non.interested.table)){
print(sum(non.interested.table[,col]))
}
[1] 3.671875
[1] 3.169492
[1] 3.375
[1] 3.157895
[1] 3.555556
[1] 3.214286
[1] 3.574468
[1] 3.789474
[1] 3.424242
[1] 3.470588
[1] 3.654545
[1] 3.581818
[1] 3.75
[1] 3.363636
[1] 3.416667
[1] 3.5
[1] 2.785714
[1] 3.342857
[1] 3.635135
#Find cases available for focused
focused.cases <- c()
emotion = "focused"
for (participant in participants_eat) {
print(paste("Pour le participant ", participant," il y a", length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")]),"correspondance(s)"))
focused.cases[participant] <- length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")])
}
[1] "Pour le participant D02P01 il y a 1 correspondance(s)"
[1] "Pour le participant D02P02 il y a 1 correspondance(s)"
[1] "Pour le participant D05P01 il y a 1 correspondance(s)"
[1] "Pour le participant D05P02 il y a 1 correspondance(s)"
[1] "Pour le participant D07P01 il y a 4 correspondance(s)"
[1] "Pour le participant D07P02 il y a 2 correspondance(s)"
[1] "Pour le participant D09P01 il y a 11 correspondance(s)"
[1] "Pour le participant D09P02 il y a 4 correspondance(s)"
[1] "Pour le participant D13P01 il y a 1 correspondance(s)"
[1] "Pour le participant D13P02 il y a 1 correspondance(s)"
[1] "Pour le participant D16P01 il y a 1 correspondance(s)"
[1] "Pour le participant D16P02 il y a 4 correspondance(s)"
[1] "Pour le participant D21P01 il y a 3 correspondance(s)"
[1] "Pour le participant D21P02 il y a 1 correspondance(s)"
[1] "Pour le participant D23P01 il y a 1 correspondance(s)"
[1] "Pour le participant D23P02 il y a 3 correspondance(s)"
[1] "Pour le participant D26P01 il y a 4 correspondance(s)"
[1] "Pour le participant D26P02 il y a 2 correspondance(s)"
[1] "Pour le participant D27P01 il y a 2 correspondance(s)"
[1] "Pour le participant D27P02 il y a 1 correspondance(s)"
[1] "Pour le participant D29P01 il y a 0 correspondance(s)"
[1] "Pour le participant D29P02 il y a 3 correspondance(s)"
focused.available.cases <- focused.cases[focused.cases != 0]
focused.available.cases
D02P01 D02P02 D05P01 D05P02 D07P01 D07P02 D09P01 D09P02 D13P01 D13P02 D16P01 D16P02 D21P01 D21P02 D23P01 D23P02
1 1 1 1 4 2 11 4 1 1 1 4 3 1 1 3
D26P01 D26P02 D27P01 D27P02 D29P02
4 2 2 1 3
length(focused.available.cases)
[1] 21
names(focused.available.cases)
[1] "D02P01" "D02P02" "D05P01" "D05P02" "D07P01" "D07P02" "D09P01" "D09P02" "D13P01" "D13P02" "D16P01" "D16P02"
[13] "D21P01" "D21P02" "D23P01" "D23P02" "D26P01" "D26P02" "D27P01" "D27P02" "D29P02"
#focused sample
participants_eat_focused_P01 <- c("D02P01","D07P01","D07P01","D09P01","D13P01","D16P01","D21P01","D23P01","D26P01","D27P01")
participants_eat_focused_P02 <- c("D02P02","D05P02","D07P02","D09P02","D13P02","D16P02","D21P02","D23P02","D26P02","D27P02","D29P02")
#Compute the real-time use for the emotion focused
#select the subset of collaborative processes for a given participant. For the emotion focused, the (max.windows.size) collaborative processes of the other's partner from the same dyad are selected
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
focused.table.p2 <- data.frame(n)
rownames(focused.table.p2) <- collaborative.processes
for (p in participants_eat_focused_P01)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
focused.collaborative.processes.table <- data.frame(m)
focused.times <- data[which(data$participant == p & data$shared.emotion =="focused"),c("unix.time.video")]
focused.times.length <- length(focused.times)
for (i in seq(1:length(focused.times)))
{
focused.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > focused.times[i]),c("collaborative.processes")][1:max.window.size]
}
focused.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(focused.collaborative.processes.table)){
if (anyNA(focused.collaborative.processes.table[,col])) {
focused.times.length <- focused.times.length-1
focused.collaborative.processes.table = focused.collaborative.processes.table[,!(names(focused.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(focused.collaborative.processes.table[focused.collaborative.processes.table == i])
}
x <- x/focused.times.length #number of emotion windows
focused.table.p2[,paste0(substr(p, 1, 5),"2")] = x
}
focused.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
focused.table.p1 <- data.frame(n)
rownames(focused.table.p1) <- collaborative.processes
for (p in participants_eat_focused_P02)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
focused.collaborative.processes.table <- data.frame(m)
focused.times <- data[which(data$participant == p & data$shared.emotion == "focused"),c("unix.time.video")]
focused.times.length <- length(focused.times)
for (i in seq(1:length(focused.times)))
{
focused.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > focused.times[i]),c("collaborative.processes")][1:max.window.size]
}
focused.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(focused.collaborative.processes.table)){
if (anyNA(focused.collaborative.processes.table[,col])) {
focused.times.length <- focused.times.length-1
focused.collaborative.processes.table = focused.collaborative.processes.table[,!(names(focused.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(focused.collaborative.processes.table[focused.collaborative.processes.table == i])
}
x <- x/focused.times.length #number of emotion windows
focused.table.p1[,paste0(substr(p, 1, 5),"1")] = x
}
focused.table.p1
focused.table <- cbind(focused.table.p1, focused.table.p2)
focused.table
#Compute the real-time use when no emotion focused
#Select a subset of the data not including the emotion windows
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.focused.table.p2 <- data.frame(n)
rownames(non.focused.table.p2) <- collaborative.processes
for (p in participants_eat_focused_P01)
{
focused.times <- data[which(data$participant == p & data$shared.emotion =="focused"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(focused.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > focused.times[i])[1:max.window.size])
}
#remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)]
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"2"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.focused.table.p2[,paste0(substr(p, 1, 5),"2")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.focused.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.focused.table.p1 <- data.frame(n)
rownames(non.focused.table.p1) <- collaborative.processes
for (p in participants_eat_focused_P02)
{
focused.times <- data[which(data$participant == p & data$shared.emotion =="focused"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(focused.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > focused.times[i])[1:max.window.size])
}
#remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)]
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"1"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.focused.table.p1[,paste0(substr(p, 1, 5),"1")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.focused.table.p1
non.focused.table <- cbind(non.focused.table.p1, non.focused.table.p2)
non.focused.table
#Find cases available for delighted
delighted.cases <- c()
emotion = "delighted"
for (participant in participants_eat) {
print(paste("Pour le participant ", participant," il y a", length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")]),"correspondance(s)"))
delighted.cases[participant] <- length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")])
}
[1] "Pour le participant D02P01 il y a 1 correspondance(s)"
[1] "Pour le participant D02P02 il y a 0 correspondance(s)"
[1] "Pour le participant D05P01 il y a 2 correspondance(s)"
[1] "Pour le participant D05P02 il y a 0 correspondance(s)"
[1] "Pour le participant D07P01 il y a 1 correspondance(s)"
[1] "Pour le participant D07P02 il y a 1 correspondance(s)"
[1] "Pour le participant D09P01 il y a 2 correspondance(s)"
[1] "Pour le participant D09P02 il y a 1 correspondance(s)"
[1] "Pour le participant D13P01 il y a 1 correspondance(s)"
[1] "Pour le participant D13P02 il y a 3 correspondance(s)"
[1] "Pour le participant D16P01 il y a 0 correspondance(s)"
[1] "Pour le participant D16P02 il y a 0 correspondance(s)"
[1] "Pour le participant D21P01 il y a 0 correspondance(s)"
[1] "Pour le participant D21P02 il y a 1 correspondance(s)"
[1] "Pour le participant D23P01 il y a 0 correspondance(s)"
[1] "Pour le participant D23P02 il y a 0 correspondance(s)"
[1] "Pour le participant D26P01 il y a 1 correspondance(s)"
[1] "Pour le participant D26P02 il y a 1 correspondance(s)"
[1] "Pour le participant D27P01 il y a 1 correspondance(s)"
[1] "Pour le participant D27P02 il y a 2 correspondance(s)"
[1] "Pour le participant D29P01 il y a 1 correspondance(s)"
[1] "Pour le participant D29P02 il y a 1 correspondance(s)"
delighted.available.cases <- delighted.cases[delighted.cases != 0]
delighted.available.cases
D02P01 D05P01 D07P01 D07P02 D09P01 D09P02 D13P01 D13P02 D21P02 D26P01 D26P02 D27P01 D27P02 D29P01 D29P02
1 2 1 1 2 1 1 3 1 1 1 1 2 1 1
length(delighted.available.cases)
[1] 15
names(delighted.available.cases)
[1] "D02P01" "D05P01" "D07P01" "D07P02" "D09P01" "D09P02" "D13P01" "D13P02" "D21P02" "D26P01" "D26P02" "D27P01"
[13] "D27P02" "D29P01" "D29P02"
#delighted sample
participants_eat_delighted_P01 <- c("D02P01","D05P01","D09P01","D26P01","D27P01","D29P01")
participants_eat_delighted_P02 <- c("D09P02","D13P02","D21P02","D27P02","D29P02")
#Compute the real-time use for the emotion delighted
#select the subset of collaborative processes for a given participant. For the emotion delighted, the (max.windows.size) collaborative processes of the other's partner from the same dyad are selected
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
delighted.table.p2 <- data.frame(n)
rownames(delighted.table.p2) <- collaborative.processes
for (p in participants_eat_delighted_P01)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
delighted.collaborative.processes.table <- data.frame(m)
delighted.times <- data[which(data$participant == p & data$shared.emotion =="delighted"),c("unix.time.video")]
delighted.times.length <- length(delighted.times)
for (i in seq(1:length(delighted.times)))
{
delighted.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > delighted.times[i]),c("collaborative.processes")][1:max.window.size]
}
delighted.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(delighted.collaborative.processes.table)){
if (anyNA(delighted.collaborative.processes.table[,col])) {
delighted.times.length <- delighted.times.length-1
delighted.collaborative.processes.table = delighted.collaborative.processes.table[,!(names(delighted.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(delighted.collaborative.processes.table[delighted.collaborative.processes.table == i])
}
x <- x/delighted.times.length #number of emotion windows
delighted.table.p2[,paste0(substr(p, 1, 5),"2")] = x
}
delighted.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
delighted.table.p1 <- data.frame(n)
rownames(delighted.table.p1) <- collaborative.processes
for (p in participants_eat_delighted_P02)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
delighted.collaborative.processes.table <- data.frame(m)
delighted.times <- data[which(data$participant == p & data$shared.emotion == "delighted"),c("unix.time.video")]
delighted.times.length <- length(delighted.times)
for (i in seq(1:length(delighted.times)))
{
delighted.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > delighted.times[i]),c("collaborative.processes")][1:max.window.size]
}
delighted.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(delighted.collaborative.processes.table)){
if (anyNA(delighted.collaborative.processes.table[,col])) {
delighted.times.length <- delighted.times.length-1
delighted.collaborative.processes.table = delighted.collaborative.processes.table[,!(names(delighted.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(delighted.collaborative.processes.table[delighted.collaborative.processes.table == i])
}
x <- x/delighted.times.length #number of emotion windows
delighted.table.p1[,paste0(substr(p, 1, 5),"1")] = x
}
delighted.table.p1
delighted.table <- cbind(delighted.table.p1, delighted.table.p2)
delighted.table
#Compute the real-time use when no emotion delighted
#Select a subset of the data not including the emotional collaborative processes that are emitted just after the emotion of interest
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.delighted.table.p2 <- data.frame(n)
rownames(non.delighted.table.p2) <- collaborative.processes
for (p in participants_eat_delighted_P01)
{
delighted.times <- data[which(data$participant == p & data$shared.emotion =="delighted"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(delighted.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > delighted.times[i])[1:max.window.size])
}
#remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)]
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"2"),]
#keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.delighted.table.p2[,paste0(substr(p, 1, 5),"2")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.delighted.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.delighted.table.p1 <- data.frame(n)
rownames(non.delighted.table.p1) <- collaborative.processes
for (p in participants_eat_delighted_P02)
{
delighted.times <- data[which(data$participant == p & data$shared.emotion =="delighted"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(delighted.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > delighted.times[i])[1:max.window.size])
}
#remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)]
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"1"),]
#keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.delighted.table.p1[,paste0(substr(p, 1, 5),"1")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.delighted.table.p1
non.delighted.table <- cbind(non.delighted.table.p1, non.delighted.table.p2)
non.delighted.table
#Find cases available for satisfied
satisfied.cases <- c()
emotion = "satisfied"
for (participant in participants_eat) {
print(paste("Pour le participant ", participant," il y a", length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")]),"correspondance(s)"))
satisfied.cases[participant] <- length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")])
}
[1] "Pour le participant D02P01 il y a 2 correspondance(s)"
[1] "Pour le participant D02P02 il y a 2 correspondance(s)"
[1] "Pour le participant D05P01 il y a 2 correspondance(s)"
[1] "Pour le participant D05P02 il y a 0 correspondance(s)"
[1] "Pour le participant D07P01 il y a 0 correspondance(s)"
[1] "Pour le participant D07P02 il y a 0 correspondance(s)"
[1] "Pour le participant D09P01 il y a 2 correspondance(s)"
[1] "Pour le participant D09P02 il y a 2 correspondance(s)"
[1] "Pour le participant D13P01 il y a 1 correspondance(s)"
[1] "Pour le participant D13P02 il y a 4 correspondance(s)"
[1] "Pour le participant D16P01 il y a 4 correspondance(s)"
[1] "Pour le participant D16P02 il y a 1 correspondance(s)"
[1] "Pour le participant D21P01 il y a 2 correspondance(s)"
[1] "Pour le participant D21P02 il y a 3 correspondance(s)"
[1] "Pour le participant D23P01 il y a 2 correspondance(s)"
[1] "Pour le participant D23P02 il y a 0 correspondance(s)"
[1] "Pour le participant D26P01 il y a 2 correspondance(s)"
[1] "Pour le participant D26P02 il y a 5 correspondance(s)"
[1] "Pour le participant D27P01 il y a 1 correspondance(s)"
[1] "Pour le participant D27P02 il y a 2 correspondance(s)"
[1] "Pour le participant D29P01 il y a 1 correspondance(s)"
[1] "Pour le participant D29P02 il y a 2 correspondance(s)"
satisfied.available.cases <- satisfied.cases[satisfied.cases != 0]
satisfied.available.cases
D02P01 D02P02 D05P01 D09P01 D09P02 D13P01 D13P02 D16P01 D16P02 D21P01 D21P02 D23P01 D26P01 D26P02 D27P01 D27P02
2 2 2 2 2 1 4 4 1 2 3 2 2 5 1 2
D29P01 D29P02
1 2
length(satisfied.available.cases)
[1] 18
names(satisfied.available.cases)
[1] "D02P01" "D02P02" "D05P01" "D09P01" "D09P02" "D13P01" "D13P02" "D16P01" "D16P02" "D21P01" "D21P02" "D23P01"
[13] "D26P01" "D26P02" "D27P01" "D27P02" "D29P01" "D29P02"
#satisfied sample
participants_eat_satisfied_P01 <- c("D02P01","D05P01","D09P01","D16P01","D21P01","D23P01","D26P01","D29P01")
participants_eat_satisfied_P02 <- c("D02P02","D09P02","D13P02","D16P02","D21P02","D26P02","D27P02","D29P02")
#Compute the real-time use for the emotion satisfied
#select the subset of collaborative processes for a given participant. For the emotion satisfied, the (max.windows.size) collaborative processes of the other's partner from the same dyad are selected
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
satisfied.table.p2 <- data.frame(n)
rownames(satisfied.table.p2) <- collaborative.processes
for (p in participants_eat_satisfied_P01)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
satisfied.collaborative.processes.table <- data.frame(m)
satisfied.times <- data[which(data$participant == p & data$shared.emotion =="satisfied"),c("unix.time.video")]
satisfied.times.length <- length(satisfied.times)
for (i in seq(1:length(satisfied.times)))
{
satisfied.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > satisfied.times[i]),c("collaborative.processes")][1:max.window.size]
}
satisfied.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(satisfied.collaborative.processes.table)){
if (anyNA(satisfied.collaborative.processes.table[,col])) {
satisfied.times.length <- satisfied.times.length-1
satisfied.collaborative.processes.table = satisfied.collaborative.processes.table[,!(names(satisfied.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(satisfied.collaborative.processes.table[satisfied.collaborative.processes.table == i])
}
x <- x/satisfied.times.length #number of emotion windows
satisfied.table.p2[,paste0(substr(p, 1, 5),"2")] = x
}
satisfied.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
satisfied.table.p1 <- data.frame(n)
rownames(satisfied.table.p1) <- collaborative.processes
for (p in participants_eat_satisfied_P02)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
satisfied.collaborative.processes.table <- data.frame(m)
satisfied.times <- data[which(data$participant == p & data$shared.emotion == "satisfied"),c("unix.time.video")]
satisfied.times.length <- length(satisfied.times)
for (i in seq(1:length(satisfied.times)))
{
satisfied.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > satisfied.times[i]),c("collaborative.processes")][1:max.window.size]
}
satisfied.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(satisfied.collaborative.processes.table)){
if (anyNA(satisfied.collaborative.processes.table[,col])) {
satisfied.times.length <- satisfied.times.length-1
satisfied.collaborative.processes.table = satisfied.collaborative.processes.table[,!(names(satisfied.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(satisfied.collaborative.processes.table[satisfied.collaborative.processes.table == i])
}
x <- x/satisfied.times.length #number of emotion windows
satisfied.table.p1[,paste0(substr(p, 1, 5),"1")] = x
}
satisfied.table.p1
satisfied.table <- cbind(satisfied.table.p1, satisfied.table.p2)
satisfied.table
#Compute the relative use when no emotion satisfied
#Select a subset of the data not including the emotional collaborative processes that are emitted just after the emotion of interest
#results for P02 participants_eat
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.satisfied.table.p2 <- data.frame(n)
rownames(non.satisfied.table.p2) <- collaborative.processes
for (p in participants_eat_satisfied_P01)
{
satisfied.times <- data[which(data$participant == p & data$shared.emotion =="satisfied"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(satisfied.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > satisfied.times[i])[1:max.window.size])
}
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)] #remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"2"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.satisfied.table.p2[,paste0(substr(p, 1, 5),"2")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.satisfied.table.p2
#results for P01 participants_eat
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.satisfied.table.p1 <- data.frame(n)
rownames(non.satisfied.table.p1) <- collaborative.processes
for (p in participants_eat_satisfied_P02)
{
satisfied.times <- data[which(data$participant == p & data$shared.emotion =="satisfied"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(satisfied.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > satisfied.times[i])[1:max.window.size])
}
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)] #remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"1"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.satisfied.table.p1[,paste0(substr(p, 1, 5),"1")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.satisfied.table.p1
non.satisfied.table <- cbind(non.satisfied.table.p1, non.satisfied.table.p2)
non.satisfied.table
#Find cases available for amused
amused.cases <- c()
emotion = "amused"
for (participant in participants_eat) {
print(paste("Pour le participant ", participant," il y a", length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")]),"correspondance(s)"))
amused.cases[participant] <- length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")])
}
[1] "Pour le participant D02P01 il y a 1 correspondance(s)"
[1] "Pour le participant D02P02 il y a 0 correspondance(s)"
[1] "Pour le participant D05P01 il y a 1 correspondance(s)"
[1] "Pour le participant D05P02 il y a 0 correspondance(s)"
[1] "Pour le participant D07P01 il y a 3 correspondance(s)"
[1] "Pour le participant D07P02 il y a 1 correspondance(s)"
[1] "Pour le participant D09P01 il y a 5 correspondance(s)"
[1] "Pour le participant D09P02 il y a 3 correspondance(s)"
[1] "Pour le participant D13P01 il y a 2 correspondance(s)"
[1] "Pour le participant D13P02 il y a 1 correspondance(s)"
[1] "Pour le participant D16P01 il y a 1 correspondance(s)"
[1] "Pour le participant D16P02 il y a 0 correspondance(s)"
[1] "Pour le participant D21P01 il y a 2 correspondance(s)"
[1] "Pour le participant D21P02 il y a 3 correspondance(s)"
[1] "Pour le participant D23P01 il y a 1 correspondance(s)"
[1] "Pour le participant D23P02 il y a 1 correspondance(s)"
[1] "Pour le participant D26P01 il y a 2 correspondance(s)"
[1] "Pour le participant D26P02 il y a 2 correspondance(s)"
[1] "Pour le participant D27P01 il y a 2 correspondance(s)"
[1] "Pour le participant D27P02 il y a 1 correspondance(s)"
[1] "Pour le participant D29P01 il y a 2 correspondance(s)"
[1] "Pour le participant D29P02 il y a 0 correspondance(s)"
amused.available.cases <- amused.cases[amused.cases != 0]
amused.available.cases
D02P01 D05P01 D07P01 D07P02 D09P01 D09P02 D13P01 D13P02 D16P01 D21P01 D21P02 D23P01 D23P02 D26P01 D26P02 D27P01
1 1 3 1 5 3 2 1 1 2 3 1 1 2 2 2
D27P02 D29P01
1 2
length(amused.available.cases)
[1] 18
names(amused.available.cases)
[1] "D02P01" "D05P01" "D07P01" "D07P02" "D09P01" "D09P02" "D13P01" "D13P02" "D16P01" "D21P01" "D21P02" "D23P01"
[13] "D23P02" "D26P01" "D26P02" "D27P01" "D27P02" "D29P01"
#amused sample
participants_eat_amused_P01 <- c("D02P01","D05P01","D07P01","D09P01","D13P01","D16P01","D21P01","D23P01","D26P01","D27P01","D29P01")
participants_eat_amused_P02 <- c("D07P02","D09P02","D13P02","D21P02","D23P02","D26P02","D27P02")
#Compute the real-time use for the emotion amused
#select the subset of collaborative processes for a given participant. For the emotion amused, the (max.windows.size) collaborative processes of the other's partner from the same dyad are selected
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
amused.table.p2 <- data.frame(n)
rownames(amused.table.p2) <- collaborative.processes
for (p in participants_eat_amused_P01)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
amused.collaborative.processes.table <- data.frame(m)
amused.times <- data[which(data$participant == p & data$shared.emotion =="amused"),c("unix.time.video")]
amused.times.length <- length(amused.times)
for (i in seq(1:length(amused.times)))
{
amused.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > amused.times[i]),c("collaborative.processes")][1:max.window.size]
}
amused.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(amused.collaborative.processes.table)){
if (anyNA(amused.collaborative.processes.table[,col])) {
amused.times.length <- amused.times.length-1
amused.collaborative.processes.table = amused.collaborative.processes.table[,!(names(amused.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(amused.collaborative.processes.table[amused.collaborative.processes.table == i])
}
x <- x/amused.times.length #number of emotion windows
amused.table.p2[,paste0(substr(p, 1, 5),"2")] = x
}
amused.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
amused.table.p1 <- data.frame(n)
rownames(amused.table.p1) <- collaborative.processes
for (p in participants_eat_amused_P02)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
amused.collaborative.processes.table <- data.frame(m)
amused.times <- data[which(data$participant == p & data$shared.emotion == "amused"),c("unix.time.video")]
amused.times.length <- length(amused.times)
for (i in seq(1:length(amused.times)))
{
amused.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > amused.times[i]),c("collaborative.processes")][1:max.window.size]
}
amused.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(amused.collaborative.processes.table)){
if (anyNA(amused.collaborative.processes.table[,col])) {
amused.times.length <- amused.times.length-1
amused.collaborative.processes.table = amused.collaborative.processes.table[,!(names(amused.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(amused.collaborative.processes.table[amused.collaborative.processes.table == i])
}
x <- x/amused.times.length #number of emotion windows
amused.table.p1[,paste0(substr(p, 1, 5),"1")] = x
}
amused.table.p1
amused.table <- cbind(amused.table.p1, amused.table.p2)
amused.table
#Compute the relative use when no emotion amused
#Select a subset of the data not including the emotional collaborative processes that are emitted just after the emotion of interest
#results for P02 participants_eat
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.amused.table.p2 <- data.frame(n)
rownames(non.amused.table.p2) <- collaborative.processes
for (p in participants_eat_amused_P01)
{
amused.times <- data[which(data$participant == p & data$shared.emotion =="amused"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(amused.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > amused.times[i])[1:max.window.size])
}
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)] #remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"2"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.amused.table.p2[,paste0(substr(p, 1, 5),"2")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.amused.table.p2
#results for P01 participants_eat
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.amused.table.p1 <- data.frame(n)
rownames(non.amused.table.p1) <- collaborative.processes
for (p in participants_eat_amused_P02)
{
amused.times <- data[which(data$participant == p & data$shared.emotion =="amused"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(amused.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > amused.times[i])[1:max.window.size])
}
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)] #remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"1"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.amused.table.p1[,paste0(substr(p, 1, 5),"1")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.amused.table.p1
non.amused.table <- cbind(non.amused.table.p1, non.amused.table.p2)
non.amused.table
#Find cases available for relaxed, i.e., the participants for which one or more sharing of relaxed occured
relaxed.cases <- c()
emotion = "relaxed"
for (participant in participants_eat) {
print(paste("Pour le participant ", participant," il y a", length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")]),"correspondance(s)"))
relaxed.cases[participant] <- length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")])
}
[1] "Pour le participant D02P01 il y a 0 correspondance(s)"
[1] "Pour le participant D02P02 il y a 0 correspondance(s)"
[1] "Pour le participant D05P01 il y a 1 correspondance(s)"
[1] "Pour le participant D05P02 il y a 2 correspondance(s)"
[1] "Pour le participant D07P01 il y a 1 correspondance(s)"
[1] "Pour le participant D07P02 il y a 0 correspondance(s)"
[1] "Pour le participant D09P01 il y a 1 correspondance(s)"
[1] "Pour le participant D09P02 il y a 2 correspondance(s)"
[1] "Pour le participant D13P01 il y a 0 correspondance(s)"
[1] "Pour le participant D13P02 il y a 1 correspondance(s)"
[1] "Pour le participant D16P01 il y a 0 correspondance(s)"
[1] "Pour le participant D16P02 il y a 1 correspondance(s)"
[1] "Pour le participant D21P01 il y a 2 correspondance(s)"
[1] "Pour le participant D21P02 il y a 2 correspondance(s)"
[1] "Pour le participant D23P01 il y a 1 correspondance(s)"
[1] "Pour le participant D23P02 il y a 0 correspondance(s)"
[1] "Pour le participant D26P01 il y a 1 correspondance(s)"
[1] "Pour le participant D26P02 il y a 2 correspondance(s)"
[1] "Pour le participant D27P01 il y a 1 correspondance(s)"
[1] "Pour le participant D27P02 il y a 1 correspondance(s)"
[1] "Pour le participant D29P01 il y a 0 correspondance(s)"
[1] "Pour le participant D29P02 il y a 0 correspondance(s)"
relaxed.available.cases <- relaxed.cases[relaxed.cases != 0]
relaxed.available.cases
D05P01 D05P02 D07P01 D09P01 D09P02 D13P02 D16P02 D21P01 D21P02 D23P01 D26P01 D26P02 D27P01 D27P02
1 2 1 1 2 1 1 2 2 1 1 2 1 1
length(relaxed.available.cases)
[1] 14
names(relaxed.available.cases)
[1] "D05P01" "D05P02" "D07P01" "D09P01" "D09P02" "D13P02" "D16P02" "D21P01" "D21P02" "D23P01" "D26P01" "D26P02"
[13] "D27P01" "D27P02"
#relaxed sample
participants_eat_relaxed_P01 <- c("D05P01","D07P01","D09P01","D21P01","D23P01","D27P01")
participants_eat_relaxed_P02 <- c("D05P02","D09P02","D16P02","D21P02","D26P02","D27P02")
#Compute the real-time use for the emotion relaxed
#select the subset of collaborative processes for a given participant. For the emotion relaxed, the (max.windows.size) collaborative processes of the other's partner from the same dyad are selected
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
relaxed.table.p2 <- data.frame(n)
rownames(relaxed.table.p2) <- collaborative.processes
for (p in participants_eat_relaxed_P01)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
relaxed.collaborative.processes.table <- data.frame(m)
relaxed.times <- data[which(data$participant == p & data$shared.emotion =="relaxed"),c("unix.time.video")]
relaxed.times.length <- length(relaxed.times)
for (i in seq(1:length(relaxed.times)))
{
relaxed.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > relaxed.times[i]),c("collaborative.processes")][1:max.window.size]
}
relaxed.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(relaxed.collaborative.processes.table)){
if (anyNA(relaxed.collaborative.processes.table[,col])) {
relaxed.times.length <- relaxed.times.length-1
relaxed.collaborative.processes.table = relaxed.collaborative.processes.table[,!(names(relaxed.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(relaxed.collaborative.processes.table[relaxed.collaborative.processes.table == i])
}
x <- x/relaxed.times.length #number of emotion windows
relaxed.table.p2[,paste0(substr(p, 1, 5),"2")] = x
}
relaxed.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
relaxed.table.p1 <- data.frame(n)
rownames(relaxed.table.p1) <- collaborative.processes
for (p in participants_eat_relaxed_P02)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
relaxed.collaborative.processes.table <- data.frame(m)
relaxed.times <- data[which(data$participant == p & data$shared.emotion == "relaxed"),c("unix.time.video")]
relaxed.times.length <- length(relaxed.times)
for (i in seq(1:length(relaxed.times)))
{
relaxed.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > relaxed.times[i]),c("collaborative.processes")][1:max.window.size]
}
relaxed.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(relaxed.collaborative.processes.table)){
if (anyNA(relaxed.collaborative.processes.table[,col])) {
relaxed.times.length <- relaxed.times.length-1
relaxed.collaborative.processes.table = relaxed.collaborative.processes.table[,!(names(relaxed.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(relaxed.collaborative.processes.table[relaxed.collaborative.processes.table == i])
}
x <- x/relaxed.times.length #number of emotion windows
relaxed.table.p1[,paste0(substr(p, 1, 5),"1")] = x
}
relaxed.table.p1
relaxed.table <- cbind(relaxed.table.p1, relaxed.table.p2)
relaxed.table
#Compute the relative use when no emotion relaxed
#Select a subset of the data not including the emotional collaborative processes that are emitted just after the emotion of interest
#results for P02 participants_eat
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.relaxed.table.p2 <- data.frame(n)
rownames(non.relaxed.table.p2) <- collaborative.processes
for (p in participants_eat_relaxed_P01)
{
relaxed.times <- data[which(data$participant == p & data$shared.emotion =="relaxed"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(relaxed.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > relaxed.times[i])[1:max.window.size])
}
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)] #remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"2"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.relaxed.table.p2[,paste0(substr(p, 1, 5),"2")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.relaxed.table.p2
#results for P01 participants_eat
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.relaxed.table.p1 <- data.frame(n)
rownames(non.relaxed.table.p1) <- collaborative.processes
for (p in participants_eat_relaxed_P02)
{
relaxed.times <- data[which(data$participant == p & data$shared.emotion =="relaxed"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(relaxed.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > relaxed.times[i])[1:max.window.size])
}
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)] #remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"1"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.relaxed.table.p1[,paste0(substr(p, 1, 5),"1")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.relaxed.table.p1
non.relaxed.table <- cbind(non.relaxed.table.p1, non.relaxed.table.p2)
non.relaxed.table
#Find cases available for confident, i.e., the participants for which one or more sharing of confident occured
confident.cases <- c()
emotion = "confident"
for (participant in participants_eat) {
print(paste("Pour le participant ", participant," il y a", length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")]),"correspondance(s)"))
confident.cases[participant] <- length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")])
}
[1] "Pour le participant D02P01 il y a 0 correspondance(s)"
[1] "Pour le participant D02P02 il y a 2 correspondance(s)"
[1] "Pour le participant D05P01 il y a 0 correspondance(s)"
[1] "Pour le participant D05P02 il y a 1 correspondance(s)"
[1] "Pour le participant D07P01 il y a 0 correspondance(s)"
[1] "Pour le participant D07P02 il y a 0 correspondance(s)"
[1] "Pour le participant D09P01 il y a 1 correspondance(s)"
[1] "Pour le participant D09P02 il y a 0 correspondance(s)"
[1] "Pour le participant D13P01 il y a 0 correspondance(s)"
[1] "Pour le participant D13P02 il y a 0 correspondance(s)"
[1] "Pour le participant D16P01 il y a 4 correspondance(s)"
[1] "Pour le participant D16P02 il y a 1 correspondance(s)"
[1] "Pour le participant D21P01 il y a 0 correspondance(s)"
[1] "Pour le participant D21P02 il y a 0 correspondance(s)"
[1] "Pour le participant D23P01 il y a 0 correspondance(s)"
[1] "Pour le participant D23P02 il y a 0 correspondance(s)"
[1] "Pour le participant D26P01 il y a 3 correspondance(s)"
[1] "Pour le participant D26P02 il y a 2 correspondance(s)"
[1] "Pour le participant D27P01 il y a 1 correspondance(s)"
[1] "Pour le participant D27P02 il y a 0 correspondance(s)"
[1] "Pour le participant D29P01 il y a 1 correspondance(s)"
[1] "Pour le participant D29P02 il y a 0 correspondance(s)"
confident.available.cases <- confident.cases[confident.cases != 0]
confident.available.cases
D02P02 D05P02 D09P01 D16P01 D16P02 D26P01 D26P02 D27P01 D29P01
2 1 1 4 1 3 2 1 1
length(confident.available.cases)
[1] 9
names(confident.available.cases)
[1] "D02P02" "D05P02" "D09P01" "D16P01" "D16P02" "D26P01" "D26P02" "D27P01" "D29P01"
#confident sample
participants_eat_confident_P01 <- c("D09P01","D16P01","D26P01","D27P01","D29P01")
participants_eat_confident_P02 <- c("D02P02","D05P02","D16P02","D26P02")
#Compute the real-time use for the emotion confident
#select the subset of collaborative processes for a given participant. For the emotion confident, the (max.windows.size) collaborative processes of the other's partner from the same dyad are selected
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
confident.table.p2 <- data.frame(n)
rownames(confident.table.p2) <- collaborative.processes
for (p in participants_eat_confident_P01)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
confident.collaborative.processes.table <- data.frame(m)
confident.times <- data[which(data$participant == p & data$shared.emotion =="confident"),c("unix.time.video")]
confident.times.length <- length(confident.times)
for (i in seq(1:length(confident.times)))
{
confident.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > confident.times[i]),c("collaborative.processes")][1:max.window.size]
}
confident.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(confident.collaborative.processes.table)){
if (anyNA(confident.collaborative.processes.table[,col])) {
confident.times.length <- confident.times.length-1
confident.collaborative.processes.table = confident.collaborative.processes.table[,!(names(confident.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(confident.collaborative.processes.table[confident.collaborative.processes.table == i])
}
x <- x/confident.times.length #number of emotion windows
confident.table.p2[,paste0(substr(p, 1, 5),"2")] = x
}
confident.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
confident.table.p1 <- data.frame(n)
rownames(confident.table.p1) <- collaborative.processes
for (p in participants_eat_confident_P02)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
confident.collaborative.processes.table <- data.frame(m)
confident.times <- data[which(data$participant == p & data$shared.emotion == "confident"),c("unix.time.video")]
confident.times.length <- length(confident.times)
for (i in seq(1:length(confident.times)))
{
confident.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > confident.times[i]),c("collaborative.processes")][1:max.window.size]
}
confident.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(confident.collaborative.processes.table)){
if (anyNA(confident.collaborative.processes.table[,col])) {
confident.times.length <- confident.times.length-1
confident.collaborative.processes.table = confident.collaborative.processes.table[,!(names(confident.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(confident.collaborative.processes.table[confident.collaborative.processes.table == i])
}
x <- x/confident.times.length #number of emotion windows
confident.table.p1[,paste0(substr(p, 1, 5),"1")] = x
}
confident.table.p1
confident.table <- cbind(confident.table.p1, confident.table.p2)
confident.table
#Compute the relative use when no emotion confident
#Select a subset of the data not including the emotional collaborative processes that are emitted just after the emotion of interest
#results for P02 participants_eat
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.confident.table.p2 <- data.frame(n)
rownames(non.confident.table.p2) <- collaborative.processes
for (p in participants_eat_confident_P01)
{
confident.times <- data[which(data$participant == p & data$shared.emotion =="confident"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(confident.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > confident.times[i])[1:max.window.size])
}
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)] #remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"2"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.confident.table.p2[,paste0(substr(p, 1, 5),"2")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.confident.table.p2
#results for P01 participants_eat
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.confident.table.p1 <- data.frame(n)
rownames(non.confident.table.p1) <- collaborative.processes
for (p in participants_eat_confident_P02)
{
confident.times <- data[which(data$participant == p & data$shared.emotion =="confident"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(confident.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > confident.times[i])[1:max.window.size])
}
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)] #remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"1"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotion chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.confident.table.p1[,paste0(substr(p, 1, 5),"1")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.confident.table.p1
non.confident.table <- cbind(non.confident.table.p1, non.confident.table.p2)
non.confident.table
#Find cases available for confused, i.e., the participants for which one or more sharing of confused occured
confused.cases <- c()
emotion = "confused"
for (participant in participants_eat) {
print(paste("Pour le participant ", participant," il y a", length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")]),"correspondance(s)"))
confused.cases[participant] <- length(data[which(data$participant == participant & data$shared.emotion == emotion),c("shared.emotion")])
}
[1] "Pour le participant D02P01 il y a 0 correspondance(s)"
[1] "Pour le participant D02P02 il y a 0 correspondance(s)"
[1] "Pour le participant D05P01 il y a 1 correspondance(s)"
[1] "Pour le participant D05P02 il y a 0 correspondance(s)"
[1] "Pour le participant D07P01 il y a 1 correspondance(s)"
[1] "Pour le participant D07P02 il y a 1 correspondance(s)"
[1] "Pour le participant D09P01 il y a 0 correspondance(s)"
[1] "Pour le participant D09P02 il y a 0 correspondance(s)"
[1] "Pour le participant D13P01 il y a 2 correspondance(s)"
[1] "Pour le participant D13P02 il y a 0 correspondance(s)"
[1] "Pour le participant D16P01 il y a 0 correspondance(s)"
[1] "Pour le participant D16P02 il y a 0 correspondance(s)"
[1] "Pour le participant D21P01 il y a 0 correspondance(s)"
[1] "Pour le participant D21P02 il y a 0 correspondance(s)"
[1] "Pour le participant D23P01 il y a 0 correspondance(s)"
[1] "Pour le participant D23P02 il y a 0 correspondance(s)"
[1] "Pour le participant D26P01 il y a 0 correspondance(s)"
[1] "Pour le participant D26P02 il y a 2 correspondance(s)"
[1] "Pour le participant D27P01 il y a 0 correspondance(s)"
[1] "Pour le participant D27P02 il y a 0 correspondance(s)"
[1] "Pour le participant D29P01 il y a 2 correspondance(s)"
[1] "Pour le participant D29P02 il y a 0 correspondance(s)"
confused.available.cases <- confused.cases[confused.cases != 0]
confused.available.cases
D05P01 D07P01 D07P02 D13P01 D26P02 D29P01
1 1 1 2 2 2
length(confused.available.cases)
[1] 6
names(confused.available.cases)
[1] "D05P01" "D07P01" "D07P02" "D13P01" "D26P02" "D29P01"
#confused sample
participants_eat_confused_P01 <- c("D05P01","D07P01","D13P01","D29P01")
participants_eat_confused_P02 <- c("D07P02","D26P02")
#Compute the real-time use for the emotion confused
#select the subset of collaborative processes for a given participant. For the emotion confused, the (max.windows.size) collaborative processes of the other's partner from the same dyad are selected
#P02 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
confused.table.p2 <- data.frame(n)
rownames(confused.table.p2) <- collaborative.processes
for (p in participants_eat_confused_P01)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
confused.collaborative.processes.table <- data.frame(m)
confused.times <- data[which(data$participant == p & data$shared.emotion =="confused"),c("unix.time.video")]
confused.times.length <- length(confused.times)
for (i in seq(1:length(confused.times)))
{
confused.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > confused.times[i]),c("collaborative.processes")][1:max.window.size]
}
confused.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(confused.collaborative.processes.table)){
if (anyNA(confused.collaborative.processes.table[,col])) {
confused.times.length <- confused.times.length-1
confused.collaborative.processes.table = confused.collaborative.processes.table[,!(names(confused.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(confused.collaborative.processes.table[confused.collaborative.processes.table == i])
}
x <- x/confused.times.length #number of emotion windows
confused.table.p2[,paste0(substr(p, 1, 5),"2")] = x
}
confused.table.p2
#P01 participants
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
confused.table.p1 <- data.frame(n)
rownames(confused.table.p1) <- collaborative.processes
for (p in participants_eat_confused_P02)
{
m <- matrix(data=NA,nrow=max.window.size,ncol=0)
confused.collaborative.processes.table <- data.frame(m)
confused.times <- data[which(data$participant == p & data$shared.emotion == "confused"),c("unix.time.video")]
confused.times.length <- length(confused.times)
for (i in seq(1:length(confused.times)))
{
confused.collaborative.processes.table[,paste0("occurence",i)] <- data[which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > confused.times[i]),c("collaborative.processes")][1:max.window.size]
}
confused.collaborative.processes.table
#check if the emotion windows all have a length of max.window.size
#when it is not the case, the emotion window is removed
for (col in colnames(confused.collaborative.processes.table)){
if (anyNA(confused.collaborative.processes.table[,col])) {
confused.times.length <- confused.times.length-1
confused.collaborative.processes.table = confused.collaborative.processes.table[,!(names(confused.collaborative.processes.table) %in% c(col))]
}
}
#compute the real-time use for every collaborative process
x <- c()
for (i in collaborative.processes)
{
x[i] <- length(confused.collaborative.processes.table[confused.collaborative.processes.table == i])
}
x <- x/confused.times.length #number of emotion windows
confused.table.p1[,paste0(substr(p, 1, 5),"1")] = x
}
confused.table.p1
confused.table <- cbind(confused.table.p1, confused.table.p2)
confused.table
#Compute the relative use when no emotion confused
#Select a subset of the data not including the emotional collaborative processes that are emitted just after the emotion of interest
#results for P02 participants_eat
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.confused.table.p2 <- data.frame(n)
rownames(non.confused.table.p2) <- collaborative.processes
for (p in participants_eat_confused_P01)
{
confused.times <- data[which(data$participant == p & data$shared.emotion =="confused"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(confused.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"2") & data$unix.time.video > confused.times[i])[1:max.window.size])
}
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)] #remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"2"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotional chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.confused.table.p2[,paste0(substr(p, 1, 5),"2")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.confused.table.p2
#results for P01 participants_eat
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
non.confused.table.p1 <- data.frame(n)
rownames(non.confused.table.p1) <- collaborative.processes
for (p in participants_eat_confused_P02)
{
confused.times <- data[which(data$participant == p & data$shared.emotion =="confused"),c("unix.time.video")]
to.be.dropped <- vector()
for (i in seq(1:length(confused.times)))
{
to.be.dropped <- c(to.be.dropped, which(data$participant == paste0(substr(p, 1, 5),"1") & data$unix.time.video > confused.times[i])[1:max.window.size])
}
to.be.dropped <- to.be.dropped[!is.na(to.be.dropped)] #remove NA when max.window.size goes out of bounds because the end of collaborative acts for that participant is reached
data.kept <- data[-to.be.dropped,] #data.kept is the data without emotional chunks
data.kept <- data.kept[data.kept$participant == paste0(substr(p, 1, 5),"1"),]
#Keep a number of lines that is a multiple of max.windows.size = number of non-emotion chunks
n <- nrow(data.kept)
data.kept <- data.kept[c(1:(n-(n%%max.window.size))),]
length(data.kept$participant)
results <- c()
for (process in collaborative.processes)
{
results <- c(results, sum(data.kept$collaborative.processes==process))
}
non.confused.table.p1[,paste0(substr(p, 1, 5),"1")] <- results/(length(data.kept$collaborative.processes)%/%max.window.size)
results <- c()
}
non.confused.table.p1
non.confused.table <- cbind(non.confused.table.p1, non.confused.table.p2)
non.confused.table
number_of_permutations = 9999
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
emotions.results.permutation.correction <- data.frame(n)
rownames(emotions.results.permutation.correction) <- collaborative.processes
emotions.results.permutation.correction$interested_p.value <- p.adjust(results, method="BH")
emotions.results.permutation.correction$interested_mean.no.emotion <- mean.no.emotion
emotions.results.permutation.correction$interested_mean.emotion <- mean.emotion
emotions.results.permutation.correction$interested_sd.no.emotion <- sd.no.emotion
emotions.results.permutation.correction$interested_sd.emotion <- sd.emotion
emotions.results.permutation.correction[,c("interested_p.value"), drop=FALSE]
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes) {
observed.mean.difference <- mean(as.numeric(focused.table[process,])) - mean(as.numeric(non.focused.table[process,]))
observed.mean.difference
random.mean.differences <- c(observed.mean.difference)
whole.sample <- c(as.numeric(focused.table[process,]),as.numeric(non.focused.table[process,])) #put together the two samples
for (i in 1:number_of_permutations) {
random.sample <- sample(whole.sample) #randomize the sample
random.treatment.sample <- random.sample[1:length(as.numeric(focused.table[process,]))] #select new treatment sample
random.control.sample <- random.sample[(1+length(as.numeric(focused.table[process,]))):length(random.sample)] #select new control sample
random.mean.differences <- c(random.mean.differences,mean(random.treatment.sample)-mean(random.control.sample))
}
results <- c(results, sum(abs(random.mean.differences) >= abs(observed.mean.difference)) / length(random.mean.differences))
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.focused.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(focused.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.focused.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(focused.table[process,])))
#graphs
hist(random.mean.differences, main = paste0("Sampling distribution ",process), xlab = "Mean difference", prob = F, col = "darkred")
abline(v = observed.mean.difference, col = "blue", lwd = 2)
}
emotions.results.permutation.correction$focused_p.value <- p.adjust(results, method="BH")
emotions.results.permutation.correction$focused_mean.no.emotion <- mean.no.emotion
emotions.results.permutation.correction$focused_mean.emotion <- mean.emotion
emotions.results.permutation.correction$focused_sd.no.emotion <- sd.no.emotion
emotions.results.permutation.correction$focused_sd.emotion <- sd.emotion
emotions.results.permutation.correction[,c("focused_p.value"), drop=FALSE]
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes) {
observed.mean.difference <- mean(as.numeric(delighted.table[process,])) - mean(as.numeric(non.delighted.table[process,]))
observed.mean.difference
random.mean.differences <- c(observed.mean.difference)
whole.sample <- c(as.numeric(delighted.table[process,]),as.numeric(non.delighted.table[process,])) #put together the two samples
for (i in 1:number_of_permutations) {
random.sample <- sample(whole.sample) #randomize the sample
random.treatment.sample <- random.sample[1:length(as.numeric(delighted.table[process,]))] #select new treatment sample
random.control.sample <- random.sample[(1+length(as.numeric(delighted.table[process,]))):length(random.sample)] #select new control sample
random.mean.differences <- c(random.mean.differences,mean(random.treatment.sample)-mean(random.control.sample))
}
results <- c(results, sum(abs(random.mean.differences) >= abs(observed.mean.difference)) / length(random.mean.differences))
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.delighted.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(delighted.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.delighted.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(delighted.table[process,])))
#graphs
hist(random.mean.differences, main = paste0("Sampling distribution ",process), xlab = "Mean difference", prob = F, col = "darkred")
abline(v = observed.mean.difference, col = "blue", lwd = 2)
}
emotions.results.permutation.correction$delighted_p.value <- p.adjust(results, method="BH")
emotions.results.permutation.correction$delighted_mean.no.emotion <- mean.no.emotion
emotions.results.permutation.correction$delighted_mean.emotion <- mean.emotion
emotions.results.permutation.correction$delighted_sd.no.emotion <- sd.no.emotion
emotions.results.permutation.correction$delighted_sd.emotion <- sd.emotion
emotions.results.permutation.correction[,c("delighted_p.value"), drop=FALSE]
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes) {
observed.mean.difference <- mean(as.numeric(satisfied.table[process,])) - mean(as.numeric(non.satisfied.table[process,]))
observed.mean.difference
random.mean.differences <- c(observed.mean.difference)
whole.sample <- c(as.numeric(satisfied.table[process,]),as.numeric(non.satisfied.table[process,])) #put together the two samples
for (i in 1:number_of_permutations) {
random.sample <- sample(whole.sample) #randomize the sample
random.treatment.sample <- random.sample[1:length(as.numeric(satisfied.table[process,]))] #select new treatment sample
random.control.sample <- random.sample[(1+length(as.numeric(satisfied.table[process,]))):length(random.sample)] #select new control sample
random.mean.differences <- c(random.mean.differences,mean(random.treatment.sample)-mean(random.control.sample))
}
results <- c(results, sum(abs(random.mean.differences) >= abs(observed.mean.difference)) / length(random.mean.differences))
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.satisfied.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(satisfied.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.satisfied.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(satisfied.table[process,])))
#graphs
hist(random.mean.differences, main = paste0("Sampling distribution ",process), xlab = "Mean difference", prob = F, col = "darkred")
abline(v = observed.mean.difference, col = "blue", lwd = 2)
}
emotions.results.permutation.correction$satisfied_p.value <- p.adjust(results, method="BH")
emotions.results.permutation.correction$satisfied_mean.no.emotion <- mean.no.emotion
emotions.results.permutation.correction$satisfied_mean.emotion <- mean.emotion
emotions.results.permutation.correction$satisfied_sd.no.emotion <- sd.no.emotion
emotions.results.permutation.correction$satisfied_sd.emotion <- sd.emotion
emotions.results.permutation.correction[,c("satisfied_p.value"), drop=FALSE]
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes) {
observed.mean.difference <- mean(as.numeric(amused.table[process,])) - mean(as.numeric(non.amused.table[process,]))
observed.mean.difference
random.mean.differences <- c(observed.mean.difference)
whole.sample <- c(as.numeric(amused.table[process,]),as.numeric(non.amused.table[process,])) #put together the two samples
for (i in 1:number_of_permutations) {
random.sample <- sample(whole.sample) #randomize the sample
random.treatment.sample <- random.sample[1:length(as.numeric(amused.table[process,]))] #select new treatment sample
random.control.sample <- random.sample[(1+length(as.numeric(amused.table[process,]))):length(random.sample)] #select new control sample
random.mean.differences <- c(random.mean.differences,mean(random.treatment.sample)-mean(random.control.sample))
}
results <- c(results, sum(abs(random.mean.differences) >= abs(observed.mean.difference)) / length(random.mean.differences))
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.amused.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(amused.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.amused.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(amused.table[process,])))
#graphs
hist(random.mean.differences, main = paste0("Sampling distribution ",process), xlab = "Mean difference", prob = F, col = "darkred")
abline(v = observed.mean.difference, col = "blue", lwd = 2)
}
emotions.results.permutation.correction$amused_p.value <- p.adjust(results, method="BH")
emotions.results.permutation.correction$amused_mean.no.emotion <- mean.no.emotion
emotions.results.permutation.correction$amused_mean.emotion <- mean.emotion
emotions.results.permutation.correction$amused_sd.no.emotion <- sd.no.emotion
emotions.results.permutation.correction$amused_sd.emotion <- sd.emotion
emotions.results.permutation.correction[,c("amused_p.value"), drop=FALSE]
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes) {
observed.mean.difference <- mean(as.numeric(relaxed.table[process,])) - mean(as.numeric(non.relaxed.table[process,]))
observed.mean.difference
random.mean.differences <- c(observed.mean.difference)
whole.sample <- c(as.numeric(relaxed.table[process,]),as.numeric(non.relaxed.table[process,])) #put together the two samples
for (i in 1:number_of_permutations) {
random.sample <- sample(whole.sample) #randomize the sample
random.treatment.sample <- random.sample[1:length(as.numeric(relaxed.table[process,]))] #select new treatment sample
random.control.sample <- random.sample[(1+length(as.numeric(relaxed.table[process,]))):length(random.sample)] #select new control sample
random.mean.differences <- c(random.mean.differences,mean(random.treatment.sample)-mean(random.control.sample))
}
results <- c(results, sum(abs(random.mean.differences) >= abs(observed.mean.difference)) / length(random.mean.differences))
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.relaxed.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(relaxed.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.relaxed.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(relaxed.table[process,])))
#graphs
hist(random.mean.differences, main = paste0("Sampling distribution ",process), xlab = "Mean difference", prob = F, col = "darkred")
abline(v = observed.mean.difference, col = "blue", lwd = 2)
}
emotions.results.permutation.correction$relaxed_p.value <- p.adjust(results, method="BH")
emotions.results.permutation.correction$relaxed_mean.no.emotion <- mean.no.emotion
emotions.results.permutation.correction$relaxed_mean.emotion <- mean.emotion
emotions.results.permutation.correction$relaxed_sd.no.emotion <- sd.no.emotion
emotions.results.permutation.correction$relaxed_sd.emotion <- sd.emotion
emotions.results.permutation.correction$mean.diff.relaxed <- (mean.emotion-mean.no.emotion)
emotions.results.permutation.correction$mean.diff.relaxed
[1] -0.49692109 -0.35209996 -0.53122708 0.33380400 -0.20373705 0.15276475 0.21975936 -0.08681058 0.43739989
[10] -0.04730812
emotions.results.permutation.correction[,c("relaxed_p.value","mean.diff.relaxed")]
n <- matrix(data=NA,nrow=length(collaborative.processes),ncol=0)
emotions.results.bh.correction <- data.frame(n)
rownames(emotions.results.bh.correction) <- collaborative.processes
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes)
{
results <- c(results, wilcox.test(t(interested.table[process,]),t(non.interested.table[process,]))$p.value)
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.interested.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(interested.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.interested.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(interested.table[process,])))
}
impossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequos
emotions.results.bh.correction$interested_p.value <- p.adjust(results, method="BH")
emotions.results.bh.correction$interested_mean.no.emotion <- mean.no.emotion
emotions.results.bh.correction$interested_mean.emotion <- mean.emotion
emotions.results.bh.correction$interested_sd.no.emotion <- sd.no.emotion
emotions.results.bh.correction$interested_sd.emotion <- sd.emotion
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes)
{
results <- c(results, wilcox.test(t(focused.table[process,]),t(non.focused.table[process,]))$p.value)
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.focused.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(focused.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.focused.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(focused.table[process,])))
}
impossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequos
emotions.results.bh.correction$focused_p.value <- p.adjust(results, method="BH")
emotions.results.bh.correction$focused_mean.no.emotion <- mean.no.emotion
emotions.results.bh.correction$focused_mean.emotion <- mean.emotion
emotions.results.bh.correction$focused_sd.no.emotion <- sd.no.emotion
emotions.results.bh.correction$focused_sd.emotion <- sd.emotion
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes)
{
results <- c(results, wilcox.test(t(delighted.table[process,]),t(non.delighted.table[process,]))$p.value)
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.delighted.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(delighted.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.delighted.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(delighted.table[process,])))
}
impossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequos
emotions.results.bh.correction$delighted_p.value <- p.adjust(results, method="BH")
emotions.results.bh.correction$delighted_mean.no.emotion <- mean.no.emotion
emotions.results.bh.correction$delighted_mean.emotion <- mean.emotion
emotions.results.bh.correction$delighted_sd.no.emotion <- sd.no.emotion
emotions.results.bh.correction$delighted_sd.emotion <- sd.emotion
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes)
{
results <- c(results, wilcox.test(t(satisfied.table[process,]),t(non.satisfied.table[process,]))$p.value)
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.satisfied.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(satisfied.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.satisfied.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(satisfied.table[process,])))
}
impossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequos
emotions.results.bh.correction$satisfied_p.value <- p.adjust(results, method="BH")
emotions.results.bh.correction$satisfied_mean.no.emotion <- mean.no.emotion
emotions.results.bh.correction$satisfied_mean.emotion <- mean.emotion
emotions.results.bh.correction$satisfied_sd.no.emotion <- sd.no.emotion
emotions.results.bh.correction$satisfied_sd.emotion <- sd.emotion
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes)
{
results <- c(results, wilcox.test(t(amused.table[process,]),t(non.amused.table[process,]))$p.value)
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.amused.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(amused.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.amused.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(amused.table[process,])))
}
impossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequos
emotions.results.bh.correction$amused_p.value <- p.adjust(results, method="BH")
emotions.results.bh.correction$amused_mean.no.emotion <- mean.no.emotion
emotions.results.bh.correction$amused_mean.emotion <- mean.emotion
emotions.results.bh.correction$amused_sd.no.emotion <- sd.no.emotion
emotions.results.bh.correction$amused_sd.emotion <- sd.emotion
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes)
{
results <- c(results, wilcox.test(t(relaxed.table[process,]),t(non.relaxed.table[process,]))$p.value)
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.relaxed.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(relaxed.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.relaxed.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(relaxed.table[process,])))
}
impossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequos
emotions.results.bh.correction$relaxed_p.value <- p.adjust(results, method="BH")
emotions.results.bh.correction$relaxed_mean.no.emotion <- mean.no.emotion
emotions.results.bh.correction$relaxed_mean.emotion <- mean.emotion
emotions.results.bh.correction$relaxed_sd.no.emotion <- sd.no.emotion
emotions.results.bh.correction$relaxed_sd.emotion <- sd.emotion
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes)
{
results <- c(results, wilcox.test(t(confident.table[process,]),t(non.confident.table[process,]))$p.value)
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.confident.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(confident.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.confident.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(confident.table[process,])))
}
impossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequos
emotions.results.bh.correction$confident_p.value <- p.adjust(results, method="BH")
emotions.results.bh.correction$confident_mean.no.emotion <- mean.no.emotion
emotions.results.bh.correction$confident_mean.emotion <- mean.emotion
emotions.results.bh.correction$confident_sd.no.emotion <- sd.no.emotion
emotions.results.bh.correction$confident_sd.emotion <- sd.emotion
results <- c()
mean.no.emotion <- c()
mean.emotion <- c()
sd.no.emotion <- c()
sd.emotion <- c()
for (process in collaborative.processes)
{
results <- c(results, wilcox.test(t(confused.table[process,]),t(non.confused.table[process,]))$p.value)
mean.no.emotion <- c(mean.no.emotion,mean(as.numeric(non.confused.table[process,])))
mean.emotion <- c(mean.emotion,mean(as.numeric(confused.table[process,])))
sd.no.emotion <- c(sd.no.emotion,sd(as.numeric(non.confused.table[process,])))
sd.emotion <- c(sd.emotion,sd(as.numeric(confused.table[process,])))
}
impossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequosimpossible de calculer la p-value exacte avec des ex-aequos
emotions.results.bh.correction$confused_p.value <- p.adjust(results, method="BH")
emotions.results.bh.correction$confused_mean.no.emotion <- mean.no.emotion
emotions.results.bh.correction$confused_mean.emotion <- mean.emotion
emotions.results.bh.correction$confused_sd.no.emotion <- sd.no.emotion
emotions.results.bh.correction$confused_sd.emotion <- sd.emotion
emotions.results.bh.correction
#Exporting results in .xlsx file
write.xlsx(emotions.results.permutation.correction, paste0("results_receiver_meaningful_acts",toString(max.window.size),".xlsx"))